#ifndef PLUGIN_H_INCLUDED
#define PLUGIN_H_INCLUDED

typedef int BOOL;

#define TRUE 1
#define FALSE 0

/**< Plugin runType */
#define RUN_ONCE                    0
#define RUN_INDEPENDET_DAEMON       1
#define RUN_EVERY_CYCLE             2


/** \brief logIt can be called by your own plugin. It will log lines to default
           WASD log file.
 *
 * \param logLevel int
 * \param format char*
 * \param ...
 * \return BOOL
 *
 */
BOOL logIt(int logLevel,char *format,...);

    /*******************************************************************
    *            Functions that a plugin needs to implement            *
    *                                                                  *
    *******************************************************************/

    /** \brief please return TRUE if the plugin is required, otherwise 0.
     *
     * \return BOOL
     *
     */
    BOOL getPluginRequire();


    /** \brief It's the runtype for the
    #define RUN_ONCE                    0
    #define RUN_INDEPENDET_DAEMON       1
    #define RUN_EVERY_CYCLE             2
     *
     * \return int
     *
     */
    int getPluginRunType();

    unsigned int getPluginRunFrequncy();


    /*! This function is used to check whether the configuration is corropted.
        This function will be triggered if the getPluginRequire return
        2)BOOL preRunPlugin(int type);
        Optional
    */
    BOOL preRunPlugin();


    /*! @fn
            reportStatus
        @description
            This function is to report status of the run_as_indenpendent_daemon plugin after default initialization is done.
        @require
            Required if the plugin runs as a indenpendent_daemon.

    */
    BOOL reportPluginStatus();


    /*! @fn
            execPlugin();
        @require
            Please notice that you have to maintain the plugin running mechanism.
            E.g.
            If your plugin restricts that only one instance can be running at the same time.
            And the plugin will run every 5 mins.
            Then you have to find a way to control it. The main daemon will schedule it every
            5 mins. It will be triggered anyway.
    */
    BOOL execPlugin();

    /*! @fn
            pluginExit
        @require
            Optional
            Required if the plugin is running as a independent daemon.
    */
    BOOL pluginExit();


    /*******************************************************************
    *            END (Functions that a plugin needs to implement)      *
    *******************************************************************/


#endif // PLUGIN_H_INCLUDED
